﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;

namespace ZhiHeng.OneCard.WpfClient.Model
{
    public class TreeViewEntity: INotifyPropertyChanged
    {
        public TreeViewEntity()
        {
            this.isChecked = true;
            DataSon = new ObservableCollection<TreeViewEntity>();
        }

        bool isChecked;
        public bool IsChecked
        {
            get
            {
                return isChecked;
            }
            set
            {
                isChecked = value;
                this.OnPropertyChanged("IsChecked");
            }
        }

        private object _data;

        public object Data
        {
            get { return _data; }
            set
            {
                _data = value;
                OnPropertyChanged("Data");
            }
        }

        private ObservableCollection<TreeViewEntity> _datason;

        public ObservableCollection<TreeViewEntity> DataSon
        {
            get { return _datason; }
            set { _datason = value;
                OnPropertyChanged("DataSon");
            }
        }



        public event PropertyChangedEventHandler PropertyChanged;
        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
}

